<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>会员活动</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no"/>
		<link rel="stylesheet" href="../css/main.css" />
	</head>
	<body>
		<div id="app">
			<img src="../images/logo.jpg" width="100%"/>
			<br /><br />
			<img :src="url" @click="newsVip" width="100%"/>
			<br /><br />
			<strong class="title">往期活动</strong>
			<br /><br />
			<img :src="item.imgUrl" style="margin-bottom:0.75rem;width:100%"
				@click="historys(item.linkUrl)" v-for="item in activitys"/>
			
		</div>
	</body>
	<script type="text/javascript" src="../js/vue.js" ></script>
	<script type="text/javascript" src="../js/rem.js" ></script>
	<script type="text/javascript" src="../js/axios.min.js" ></script>
	<script>
		new Vue({
			el:"#app",
			data:{
				url:"",
				links:"",
				activitys:[]
			},
			created(){
				axios.get("http://106.13.55.49/api/activity/list")
				.then(data => {
					console.log(data);
					if(data.data.status == 200){
						let datas=data.data.data;
						this.url=datas[0].imgUrl;
						this.links=datas[0].linkUrl;
						for(var i=1;i<datas.length;i++){
							this.activitys.push(datas[i]);
						}
					}else{
						this.$toast(data.data.message);return;
					}
					
				});
			},
			methods:{
				newsVip:function(){
					//会员活动的链接
					window.location.href=this.links;
				},
				historys:function(urls){
					window.location.href=urls;
				}
			}
			
		})
	</script>
</html>
